import { Entity, Column, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from "typeorm"
import { User } from './User'
@Entity({ name: 'user_auths' })
export class UserAuth {
    @PrimaryGeneratedColumn()
    readonly id!: number

    @Column()
    identity_type!: string

    @Column()
    identity!: string

    @Column()
    avatar!: string

    @Column()
    credential!: string

    @ManyToOne(type => User, {
        cascade: true
    })
    @JoinColumn({ name: 'user_id' })
    user!: User
}